import request from '@/utile/request.js'
const getCommentAPI = ({ source, offset, limit = 10 }) => {
  return request({
    url: '/v1_0/comments',
    params: {
      type: 'a',
      source,
      offset,
      limit
    }
  })
}
const LikeCommentAPI = ({ target }) => {
  return request({
    url: '/v1_0/comment/likings',
    method: 'POST',
    data: {
      target
    }
  })
}
const DislikeCommentAPI = ({ target }) => {
  return request({
    url: `/v1_0/comment/likings/${target}`,
    method: 'DELETE'
  })
}
const PutCommentAPI = ({ target, content }) => {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data: {
      target,
      content
    }
  })
}
export { getCommentAPI, LikeCommentAPI, DislikeCommentAPI, PutCommentAPI }
